package com.rz.htk.order.controller;

import com.rz.core.kit.RespKit;
import com.rz.core.resp.ResultResp;
import com.rz.htk.order.entity.Recipients;
import com.rz.htk.order.entity.vo.OrderDeleteParam;
import com.rz.htk.order.service.RecipientsService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/recipients")
public class RecipientsController {

    @Resource
    private RecipientsService recipientsService;

    @PostMapping("/getPage")
    public ResultResp getPage(@RequestBody Recipients recipients){
        return RespKit.success(recipientsService.getPage(recipients));
    }

    @PostMapping("/saveProduct")
    public ResultResp saveProduct(@RequestBody Recipients recipients){
        return RespKit.success(recipientsService.saveRecipients(recipients));
    }

    @PostMapping("/batchDelete")
    public ResultResp batchDelete(@RequestBody OrderDeleteParam deleteParam){
        return RespKit.success(recipientsService.batchDelete(deleteParam));
    }
}
